<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>


<div
	style="position: absolute; left: 10px; width: 30%; border: 1px solid blue;">
	<label>Nome: </label>
	<bean:write name="cv" property="nome" />
	<br /> <label>Cognome: </label>
	<bean:write name="cv" property="cognome" />
	<br /> <label>Sesso: </label>
	<bean:write name="cv" property="sesso" />
	<br /> <label>Et&agrave;: </label>
	<bean:write name="cv" property="eta" />
	<br /> <label>Download: </label>
	<bean:write name="cv" property="file" />

	<br /> <label>Data ultimo aggiornamento: </label>
	<bean:write name="cv" property="datacv" />
	<br /> <label>Data di inserimento: </label>
	<bean:write name="cv" property="datainserimento" />

</div>

<div
	style="position: absolute; right: 20px; height: 80% !important; overflow: auto; width: 40%; text-align: right; ">
	<logic:present parameter="commenti" name="commento">
		<b>Commenti</b>
	</logic:present>
	
		<logic:iterate id="commento" name="commenti">
			
				<div style="padding: 10px; border-bottom: 1px solid blue;">
	
				<div>
					<label>Scritto da </label>
					<bean:write name="commento" property="autore" />
					<label> in data </label>
					<bean:write name="commento" property="data" />

					<bean:define id="rate" name="commento" property="rating"></bean:define>
					
					<% int stars=(Integer)rate;
					for(int i=1;i<=stars;i++){%>
								<i class="fa fa-star"></i> 
								<%} %>
								
					<%for(;stars<5;stars++){%>
								<i class="fa fa-star-o"></i> 
								<%} %>

				</div> <bean:write name="commento" property="testo" />
				</div>		
		</logic:iterate>
	
</div>

<div
	style="position: absolute; bottom: 30px;  padding: 4px;">
	
		<div>
			<label>Vota: </label> <i id="1" onclick="star(this.id)"
				class="fa fa-star-o"></i> <i id="2" onclick="star(this.id)"
				class="fa fa-star-o"></i> <i id="3" onclick="star(this.id)"
				class="fa fa-star-o"></i> <i id="4" onclick="star(this.id)"
				class="fa fa-star-o"></i> <i id="5" onclick="star(this.id)"
				class="fa fa-star-o"></i>
		</div>


		<script type="text/javascript">
			function star(id) {
				var i;
				for (i = 1; i <= id; i++) {
					document.getElementById(i).className = 'fa fa-star';
				}

				for (i; i <= 5; i++) {
					document.getElementById(i).className = 'fa fa-star-o';
				}
			}
		</script>

		<input type="hidden" id="commento_id_cv"
			value="<bean:write name='cv' property='id' />" />

		<textarea id="commento_testo" placeholder="... commenta"
			></textarea>
		<a onclick="InsertCommento()"> <i class="fa fa-paper-plane" style="color: blue; font-size: x-large;"></i> </a>

	
</div>